%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/polymorphic/person-app-vulns.app-page-2"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 10, 11, 40, 90, 95, 118, 119, 120, 12, 29<br />2: PgSelect[9]<br />3: Connection[13]<br />4: ConnectionItems[15]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 13, 15, 12, 119, 29, 40, 90, 95<br /><br />ROOT Connectionᐸ9ᐳ[13]"):::bucket
    Bucket3("Bucket 3 (listItem)<br />Deps: 12, 119, 29, 40, 90, 95<br /><br />ROOT __Item{3}ᐸ15ᐳ[18]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 19, 12, 119, 29, 40, 90, 95<br /><br />ROOT PgSelectSingle{3}ᐸpeopleᐳ[19]<br />1: <br />ᐳ: 20, 21<br />2: PgUnionAll[24]<br />3: Connection[28]<br />4: ConnectionItems[30]"):::bucket
    Bucket6("Bucket 6 (listItem)<br />Deps: 24, 40, 12, 119, 90, 95<br /><br />ROOT __Item{6}ᐸ30ᐳ[33]"):::bucket
    Bucket7("Bucket 7 (nullableBoundary)<br />Deps: 42, 34, 12, 44, 119, 90, 95, 36<br /><br />ROOT Edge{6}[34]"):::bucket
    Bucket8("Bucket 8 (polymorphic)<br />__typename: Access[43]<br />Deps: 43, 12, 44, 119, 90, 95"):::bucket
    Bucket9("Bucket 9 (polymorphicPartition)<br />|AwsApplication<br />Deps: 12, 44, 119, 90<br />ᐳAwsApplication<br /><br />1: PgSelect[45]<br />2: PgSelectRows[50]<br />ᐳ: 49, 51, 60<br />3: PgUnionAll[62]<br />4: Connection[66]<br />5: ConnectionItems[72]"):::bucket
    Bucket10("Bucket 10 (polymorphicPartition)<br />|GcpApplication<br />Deps: 12, 44, 119, 95<br />ᐳGcpApplication<br /><br />1: PgSelect[53]<br />2: PgSelectRows[58]<br />ᐳ: 57, 59, 61<br />3: PgUnionAll[67]<br />4: Connection[71]<br />5: ConnectionItems[75]"):::bucket
    Bucket13("Bucket 13 (listItem)<br />Deps: 62, 90, 12<br /><br />ROOT __Item{13}ᐸ72ᐳ[78]"):::bucket
    Bucket14("Bucket 14 (listItem)<br />Deps: 67, 95, 12<br /><br />ROOT __Item{14}ᐸ75ᐳ[80]"):::bucket
    Bucket15("Bucket 15 (nullableBoundary)<br />Deps: 78, 90, 79, 12, 83<br /><br />ROOT Edge{13}[79]"):::bucket
    Bucket16("Bucket 16 (nullableBoundary)<br />Deps: 80, 95, 81, 12, 85<br /><br />ROOT Edge{14}[81]"):::bucket
    Bucket17("Bucket 17 (combined)<br />Deps: 12"):::bucket
    Bucket18("Bucket 18 (polymorphic)<br />__typename: Access[99]<br />Deps: 99, 12, 100"):::bucket
    Bucket19("Bucket 19 (polymorphicPartition)<br />|FirstPartyVulnerability<br />Deps: 12, 100<br />(2) ...ᐳFirstPartyVulnerability<br /><br />1: PgSelect[101]<br />2: PgSelectRows[106]<br />ᐳ: 105, 107, 116"):::bucket
    Bucket20("Bucket 20 (polymorphicPartition)<br />|ThirdPartyVulnerability<br />Deps: 12, 100<br />(2) ...ᐳThirdPartyVulnerability<br /><br />1: PgSelect[109]<br />2: PgSelectRows[114]<br />ᐳ: 113, 115, 117"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3
    Bucket3 --> Bucket4
    Bucket4 --> Bucket6
    Bucket6 --> Bucket7
    Bucket7 --> Bucket8
    Bucket8 --> Bucket9 & Bucket10
    Bucket9 --> Bucket13
    Bucket10 --> Bucket14
    Bucket13 --> Bucket15
    Bucket14 --> Bucket16
    Bucket15 --> Bucket17
    Bucket16 --> Bucket17
    Bucket17 --> Bucket18
    Bucket18 --> Bucket19 & Bucket20

    %% plan dependencies
    PgSelect9[["PgSelect[9∈0] ➊<br />ᐸpeopleᐳ<br />More deps:<br />- Object[12]<br />- Constantᐸ4ᐳ[118]"]]:::plan
    Object12{{"Object[12∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 8"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access10 & Access11 --> Object12
    Connection13[["Connection[13∈0] ➊<br />ᐸ9ᐳ<br />More deps:<br />- Constantᐸ4ᐳ[118]"]]:::plan
    PgSelect9 --> Connection13
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access10
    __Value2 --> Access11
    ConnectionItems15[["ConnectionItems[15∈0] ➊"]]:::plan
    Connection13 --> ConnectionItems15
    Lambda29{{"Lambda[29∈0] ➊<br />ᐸparseCursorᐳ<br />More deps:<br />- Constantᐸ'WyI0OTgwM2MxZTJiIiwiQXdzQXBwbGljYXRpb24iLCJbXCI0XCJdIl0='ᐳ[120]"}}:::plan
    __Item18[/"__Item[18∈3]<br />ᐸ15ᐳ"\]:::itemplan
    ConnectionItems15 ==> __Item18
    PgSelectSingle19{{"PgSelectSingle[19∈3]<br />ᐸpeopleᐳ"}}:::plan
    __Item18 --> PgSelectSingle19
    PgUnionAll24[["PgUnionAll[24∈4]<br />ᐸAwsApplication,GcpApplicationᐳ<br />More deps:<br />- Object[12]<br />- Constantᐸ1ᐳ[119]"]]:::plan
    PgClassExpression20{{"PgClassExpression[20∈4]<br />ᐸ__people__.”person_id”ᐳ"}}:::plan
    PgClassExpression20 & Lambda29 --> PgUnionAll24
    Connection28[["Connection[28∈4]<br />ᐸ24ᐳ<br />More deps:<br />- Constantᐸ1ᐳ[119]"]]:::plan
    PgUnionAll24 & Lambda29 --> Connection28
    PgSelectSingle19 --> PgClassExpression20
    PgClassExpression21{{"PgClassExpression[21∈4]<br />ᐸ__people__.”username”ᐳ"}}:::plan
    PgSelectSingle19 --> PgClassExpression21
    ConnectionItems30[["ConnectionItems[30∈4]"]]:::plan
    Connection28 --> ConnectionItems30
    List41{{"List[41∈6]<br />ᐸ38,39,40ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[40]"}}:::plan
    Access38{{"Access[38∈6]<br />ᐸ33.0ᐳ"}}:::plan
    Access39{{"Access[39∈6]<br />ᐸ33.1ᐳ"}}:::plan
    Access38 & Access39 --> List41
    Edge34{{"Edge[34∈6]"}}:::plan
    __Item33[/"__Item[33∈6]<br />ᐸ30ᐳ"\]:::itemplan
    PgCursor36{{"PgCursor[36∈6]"}}:::plan
    __Item33 & PgCursor36 --> Edge34
    Access35{{"Access[35∈6]<br />ᐸ24.cursorDetailsᐳ"}}:::plan
    __Item33 & Access35 --> PgCursor36
    ConnectionItems30 ==> __Item33
    PgUnionAll24 --> Access35
    __Item33 --> Access38
    __Item33 --> Access39
    Lambda42{{"Lambda[42∈6]<br />ᐸtoSpecifierᐳ"}}:::plan
    List41 --> Lambda42
    Access44{{"Access[44∈6]<br />ᐸ42.idᐳ"}}:::plan
    Lambda42 --> Access44
    Access43{{"Access[43∈7]<br />ᐸ42.__typenameᐳ"}}:::plan
    Lambda42 --> Access43
    PgUnionAll62[["PgUnionAll[62∈9]^<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[12]<br />- Constantᐸ1ᐳ[119]"]]:::plan
    PgClassExpression60{{"PgClassExpression[60∈9]^<br />ᐸ__aws_appl...ons__.”id”ᐳ"}}:::plan
    PgClassExpression60 --> PgUnionAll62
    PgSelect45[["PgSelect[45∈9]<br />ᐸaws_applicationsᐳ<br />ᐳAwsApplication<br />More deps:<br />- Object[12]"]]:::plan
    Access44 --> PgSelect45
    Connection66[["Connection[66∈9]^<br />ᐸ62ᐳ<br />More deps:<br />- Constantᐸ1ᐳ[119]"]]:::plan
    PgUnionAll62 --> Connection66
    First49{{"First[49∈9]^"}}:::plan
    PgSelectRows50[["PgSelectRows[50∈9]^"]]:::plan
    PgSelectRows50 --> First49
    PgSelect45 --> PgSelectRows50
    PgSelectSingle51{{"PgSelectSingle[51∈9]^<br />ᐸaws_applicationsᐳ"}}:::plan
    First49 --> PgSelectSingle51
    PgSelectSingle51 --> PgClassExpression60
    ConnectionItems72[["ConnectionItems[72∈9]^"]]:::plan
    Connection66 --> ConnectionItems72
    PgUnionAll67[["PgUnionAll[67∈10]^<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[12]<br />- Constantᐸ1ᐳ[119]"]]:::plan
    PgClassExpression61{{"PgClassExpression[61∈10]^<br />ᐸ__gcp_appl...ons__.”id”ᐳ"}}:::plan
    PgClassExpression61 --> PgUnionAll67
    PgSelect53[["PgSelect[53∈10]<br />ᐸgcp_applicationsᐳ<br />ᐳGcpApplication<br />More deps:<br />- Object[12]"]]:::plan
    Access44 --> PgSelect53
    Connection71[["Connection[71∈10]^<br />ᐸ67ᐳ<br />More deps:<br />- Constantᐸ1ᐳ[119]"]]:::plan
    PgUnionAll67 --> Connection71
    First57{{"First[57∈10]^"}}:::plan
    PgSelectRows58[["PgSelectRows[58∈10]^"]]:::plan
    PgSelectRows58 --> First57
    PgSelect53 --> PgSelectRows58
    PgSelectSingle59{{"PgSelectSingle[59∈10]^<br />ᐸgcp_applicationsᐳ"}}:::plan
    First57 --> PgSelectSingle59
    PgSelectSingle59 --> PgClassExpression61
    ConnectionItems75[["ConnectionItems[75∈10]^"]]:::plan
    Connection71 --> ConnectionItems75
    Edge79{{"Edge[79∈13]^"}}:::plan
    __Item78[/"__Item[78∈13]<br />ᐸ72ᐳ<br />ᐳAwsApplication"\]:::itemplan
    PgCursor83{{"PgCursor[83∈13]^"}}:::plan
    __Item78 & PgCursor83 --> Edge79
    Access82{{"Access[82∈13]<br />ᐸ62.cursorDetailsᐳ<br />ᐳAwsApplication"}}:::plan
    __Item78 & Access82 --> PgCursor83
    ConnectionItems72 ==> __Item78
    PgUnionAll62 --> Access82
    Edge81{{"Edge[81∈14]^"}}:::plan
    __Item80[/"__Item[80∈14]<br />ᐸ75ᐳ<br />ᐳGcpApplication"\]:::itemplan
    PgCursor85{{"PgCursor[85∈14]^"}}:::plan
    __Item80 & PgCursor85 --> Edge81
    Access84{{"Access[84∈14]<br />ᐸ67.cursorDetailsᐳ<br />ᐳGcpApplication"}}:::plan
    __Item80 & Access84 --> PgCursor85
    ConnectionItems75 ==> __Item80
    PgUnionAll67 --> Access84
    List91{{"List[91∈15]^<br />ᐸ88,89,90ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[90]"}}:::plan
    Access88{{"Access[88∈15]<br />ᐸ78.0ᐳ<br />ᐳAwsApplication"}}:::plan
    Access89{{"Access[89∈15]<br />ᐸ78.1ᐳ<br />ᐳAwsApplication"}}:::plan
    Access88 & Access89 --> List91
    __Item78 --> Access88
    __Item78 --> Access89
    Lambda92{{"Lambda[92∈15]^<br />ᐸtoSpecifierᐳ"}}:::plan
    List91 --> Lambda92
    List96{{"List[96∈16]^<br />ᐸ93,94,95ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[95]"}}:::plan
    Access93{{"Access[93∈16]<br />ᐸ80.0ᐳ<br />ᐳGcpApplication"}}:::plan
    Access94{{"Access[94∈16]<br />ᐸ80.1ᐳ<br />ᐳGcpApplication"}}:::plan
    Access93 & Access94 --> List96
    __Item80 --> Access93
    __Item80 --> Access94
    Lambda97{{"Lambda[97∈16]^<br />ᐸtoSpecifierᐳ"}}:::plan
    List96 --> Lambda97
    Access99{{"Access[99∈17]^<br />ᐸ98.__typenameᐳ"}}:::plan
    __Value98:::plan@{shape: docs, label: "__Combined[98∈17]<br />ᐳAwsApplication<br />ᐳGcpApplication"}
    __Value98 --> Access99
    Access100{{"Access[100∈17]^<br />ᐸ98.idᐳ"}}:::plan
    __Value98 --> Access100
    PgSelect101[["PgSelect[101∈19]<br />ᐸfirst_party_vulnerabilitiesᐳ<br />(2) ...ᐳFirstPartyVulnerability<br />More deps:<br />- Object[12]"]]:::plan
    Access100 --> PgSelect101
    First105{{"First[105∈19]^"}}:::plan
    PgSelectRows106[["PgSelectRows[106∈19]^"]]:::plan
    PgSelectRows106 --> First105
    PgSelect101 --> PgSelectRows106
    PgSelectSingle107{{"PgSelectSingle[107∈19]^<br />ᐸfirst_party_vulnerabilitiesᐳ"}}:::plan
    First105 --> PgSelectSingle107
    PgClassExpression116{{"PgClassExpression[116∈19]^<br />ᐸ__first_pa...ies__.”id”ᐳ"}}:::plan
    PgSelectSingle107 --> PgClassExpression116
    PgSelect109[["PgSelect[109∈20]<br />ᐸthird_party_vulnerabilitiesᐳ<br />(2) ...ᐳThirdPartyVulnerability<br />More deps:<br />- Object[12]"]]:::plan
    Access100 --> PgSelect109
    First113{{"First[113∈20]^"}}:::plan
    PgSelectRows114[["PgSelectRows[114∈20]^"]]:::plan
    PgSelectRows114 --> First113
    PgSelect109 --> PgSelectRows114
    PgSelectSingle115{{"PgSelectSingle[115∈20]^<br />ᐸthird_party_vulnerabilitiesᐳ"}}:::plan
    First113 --> PgSelectSingle115
    PgClassExpression117{{"PgClassExpression[117∈20]^<br />ᐸ__third_pa...ies__.”id”ᐳ"}}:::plan
    PgSelectSingle115 --> PgClassExpression117

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect9,Access10,Access11,Object12,Connection13,ConnectionItems15,Lambda29 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item18,PgSelectSingle19 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,PgClassExpression20,PgClassExpression21,PgUnionAll24,Connection28,ConnectionItems30 bucket4
    classDef bucket6 stroke:#ff1493
    class Bucket6,__Item33,Edge34,Access35,PgCursor36,Access38,Access39,List41,Lambda42,Access44 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,Access43 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8 bucket8
    classDef bucket9 stroke:#ff0000
    class Bucket9,PgSelect45,First49,PgSelectRows50,PgSelectSingle51,PgClassExpression60,PgUnionAll62,Connection66,ConnectionItems72 bucket9
    classDef bucket10 stroke:#ffff00
    class Bucket10,PgSelect53,First57,PgSelectRows58,PgSelectSingle59,PgClassExpression61,PgUnionAll67,Connection71,ConnectionItems75 bucket10
    classDef bucket13 stroke:#3cb371
    class Bucket13,__Item78,Edge79,Access82,PgCursor83 bucket13
    classDef bucket14 stroke:#a52a2a
    class Bucket14,__Item80,Edge81,Access84,PgCursor85 bucket14
    classDef bucket15 stroke:#ff00ff
    class Bucket15,Access88,Access89,List91,Lambda92 bucket15
    classDef bucket16 stroke:#f5deb3
    class Bucket16,Access93,Access94,List96,Lambda97 bucket16
    classDef bucket17 stroke:#696969
    class Bucket17,__Value98,Access99,Access100 bucket17
    classDef bucket18 stroke:#00bfff
    class Bucket18 bucket18
    classDef bucket19 stroke:#7f007f
    class Bucket19,PgSelect101,First105,PgSelectRows106,PgSelectSingle107,PgClassExpression116 bucket19
    classDef bucket20 stroke:#ffa500
    class Bucket20,PgSelect109,First113,PgSelectRows114,PgSelectSingle115,PgClassExpression117 bucket20

    Lambda92 -.-x __Value98
    Lambda97 -.-x __Value98
